<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use App\Common\Common;
use Exception;
use App\Jobs\SyncSendSms;

class Hello extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'Hello';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle()
    {
        $mobile = '13311180918';
        $token = mt_rand(1111, 9999);
        // $content = '【欢生活】您的手机验证码为'.$token.', 十分钟有效。如非本人操作请忽视';
        // $this->info($mobile ."\t". $content);
        // SyncSendSms::dispatch('phone', $mobile, $content);

        // $content = '【欢生活】尊敬的用户，您获得了一张家政服务抵用券，点击链接http://nutbox.huan.tv 使用。回复T退订';
        // $this->info($mobile ."\t". $content);
        // SyncSendSms::dispatch('card', $mobile, $content);

        $content = '【欢生活】尊敬的联通用户，恭喜您获得了平安权益礼包，请您用办理业务的手机号和验证码登录平安好车主APP，点击“我的”，在“我的卡券”中查看相关权益。回复T退订';
        $this->info($mobile ."\t". $content);
        SyncSendSms::dispatch("pingan", $mobile, $content);
        return 0;
    }
}
